public class Ex4_40{
	public static void main(String[] args){
		final int times = 1000000;
		int count0 = 0, count1 = 0;
		for (int i = 0; i < times; i++){
			int coin = (int)(Math.random()*2);
			if (coin == 0)
				count0++;
			else
				count1++;
		}
		System.out.printf("The number of heads is: %d\n", count0);
		System.out.printf("The number of tails is: %d\n", count1);
	}
}